﻿@{
    ViewBag.Title = "MSettingRuleForm";
    Layout = "~/Views/Shared/_LayoutIndex.cshtml";
}
<script>
    var keyValue = "";
    $(function () {
        InitialPage();
        GetTree();
        GetGrid();
    })
    function InitialPage() {
        //layout布局
        $('#layout').layout({
            applyDemoStyles: true,
            onresize: function () {
                $(window).resize()
            }
        });
        $(window).resize(function (e) {
            window.setTimeout(function () {
                $('#gridTable').setGridWidth(($('.gridPanel').width()));
                $("#gridTable").setGridHeight($(window).height() - 161.5);

            }, 200);
            e.stopPropagation();

        });
    }
    function GetTree() {
        var item = {
            height: $(window).height() - 55.5,
            url: "../../QualificationManage/FirstTrial/GetMaterialTree",
            onnodeclick: function (item) {
            }
        };
        //初始化
        $("#itemTree1").treeview(item);
    }

    function GetGrid() {
        var selectedRowIndex = 0;
        $gridTable = $("#gridTable");
        var keyValue = "";
        $gridTable.jqGrid({
            url: "../../QualificationManage/FirstTrial/GetRuleList",
            datatype: "json",
            height: $(window).height() - 113,
            autowidth: true,
            colModel: [
                { label: "主键", name: "Id", hidden: true },
                { label: "婚姻状态", name: "MarryInfo", index: "MarryInfo", width: 200, align: "center", sortable: false },
                { label: "本地户籍", name: "IsPermant", index: "IsPerMant", width: 300, align: "center", sortable: false },
                { label: "外地居住证", name: "YDLiveCard", index: "YDLiveCard", width: 200, align: "center", sortable: false }
            ],
            viewrecords: true,
            rowNum: 1000,
            rownumbers: true,
            gridview: true,
            onSelectRow: function (status) {
            },
            gridComplete: function () {
            }
        });
    }

    function btn_MaterialRuleSetting() {
        dialogOpen({
            id: "RSettingForm",
            title: '规则配置',
            url: '/QualificationManage/FirstTrial/RSettingForm',
            width: "1000px",
            height: "750px",
            callBack: function (iframeId) {
                top.frames[iframeId].AcceptClick();
            }
        })

    }

</script>
<div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    <div class="ui-layout-west">
        <div class="west-Panel">
            <div class="panel-Title" style="padding:0px; text-align:center;">材料列表</div>
            <div id="itemTree1">
            </div>
        </div>
    </div>
    <div class="ui-layout-center">
        <div class="center-Panel">
            <div class="titlePanel">
                <div class="toolbar">
                    <div class="btn-group">
                        <a id="lr-addRuleSetting" class="btn btn-default " onclick="btn_MaterialRuleSetting()"><i class="fa fa-wrench"></i>&nbsp;配置材料规则</a>
                    </div>
                    <script>$('.toolbar').authorizeButton()</script>
                </div>
            </div>


            <div class="gridPanel">
                <table id="gridTable"></table>
            </div>

        </div>
    </div>
</div>
